<?
// Session control
session_start();

//error_reporting(0);

//Charset and content-type
ini_set("default_charset", "utf-8");
header("Content-type: text/html; charset=utf-8");

require_once '/var/www/include/admin/config.php';

require_once $com_inc_path.'localization.php';
// Define language to be used
$loc = new localization($available_languages, $default_language);
$labels = $loc->load_labels($translation_files);

require_once $com_inc_path.'class_Skinner.php';
require_once $app_inc_path.'database.php';
require_once $app_inc_path.'x_admin.php';
require_once $app_inc_path.'x_log.php';
require_once $app_inc_path.'x_remots.php';
require_once $app_inc_path.'x_denegats.php';
require_once $app_inc_path.'x_users.php';
require_once $app_inc_path.'x_actius.php';
require_once $app_inc_path.'x_alta.php';

// Stablish connection to DB
$db_manager=new database($db_host, $db_user, $db_pswd, $db_name);
$db_manager->connect();

// Controller -> Business logic
require_once $app_inc_path.'controller.php';

// View -> Build output page.
require_once $app_inc_path.'left_pane.php';
$skinner = new Skinner();
$skinner->setSkin($skins_path."index");
$skinner->registerVariable("page_title", $labels["LBL_PAGE_TITLE"]);
$skinner->registerVariable("files_path", $files_path);
$skinner->registerVariable("left_pane", $left_pane);
$skinner->registerVariable("content", $content);
echo $skinner->doSubstitution_FAST();

$db_manager->disconnect();
?>
